/*
 * Copyright 2010,2011 Michael Nitsche
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package de.mnit.basis.crypt.cipher;


/**
 * @author Michael Nitsche
 * 08.01.2007	Erstellt
 */
public enum JAVA_CIPHER {

	BLOWFISH   ("Blowfish",  1,16),
	DES        ("DES"     ,  8, 8),
	RC2        ("RC2"     ,  5,16),
	RC4        ("RC4"     ,  5,16),
	RIJNDAEL   ("Rijndael", 16,16),
	TRIPLE_DES ("DESede"  , 24,24);


	public static JAVA_CIPHER AES=JAVA_CIPHER.RIJNDAEL;


	public final int laengeMin;
	public final int laengeMax;
	public final String javaName;
	private JavaCipher jc;


	private JAVA_CIPHER(String java, int min, int max) {
		this.laengeMin=min;
		this.laengeMax=max;
		this.javaName=java;
	}


	public JavaCipher instanz() {
		return jc!=null
			? jc
			: (jc=new JavaCipher(this));
	}
}
